package br.gov.cemaden.library.repository.previsao;

import br.gov.cemaden.library.model.previsao.PrevisaoTempo;
import javax.persistence.EntityManager;

/**
 *
 * @author alan
 */
public class PrevisaoTempoRepository {
    
    private final EntityManager em;

    public PrevisaoTempoRepository(EntityManager em) {
        this.em = em;
    }
    
    public PrevisaoTempo persist(PrevisaoTempo p){
        em.getTransaction().begin();
        em.persist(p);        
        em.flush();
        em.getTransaction().commit();
        em.refresh(p);
        return p;
    }
    
    
}
